<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link href="images/reset.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<link href="images/system.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" /> 
<link href="images/table_form.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}"></script>
<link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/phpyun_layer.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="js/admin_public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
 
<title>后台管理</title>
</head>
<body class="body_ifm">

<div class="infoboxp"> 
			<div class="tabs_info">
				<ul>
					<li>
						<a href="index.php?m=friendhelp">参数配置</a>
					</li>
					<li class="curr">
						<a href="index.php?m=friendhelp&c=list">助力记录</a>
					</li>
				</ul>
			</div>
	<div class="admin_new_tip">
		<a href="javascript:;" class="admin_new_tip_close"></a>
		<a href="javascript:;" class="admin_new_tip_open" style="display:none;"></a>
		<div class="admin_new_tit"><i class="admin_new_tit_icon"></i>操作提示</div>
		
		<div class="admin_new_tip_list_cont">
			{yun:}if $smarty.get.comid!=""{/yun}
				<div class="admin_new_tip_list">该页面展示了网站企业用户：<font color="#f00">【{yun:}$ccname{/yun}】</font> 的好友助力信息。</div>
			{yun:}else{/yun}
				<div class="admin_new_tip_list">该页面展示了网站所有的好友助力信息。</div>
			{yun:}/if{/yun}
			<div class="admin_new_tip_list">可输入名称关键字进行搜索，也可进行详细的高级搜索。</div>
		</div>

	</div>
 

	<div class="clear"></div>

	<div class="admin_new_search_box"> 
		<form action="index.php" name="myform" method="get">
            <input type="hidden" name="pytoken" value="{yun:}$pytoken{/yun}"> 
            <input name="m" value="company_order" type="hidden"/>   
            <input name="typezf" value="{yun:}$smarty.get.typezf{/yun}" type="hidden"/>   
            <input name="typedd" value="{yun:}$smarty.get.typedd{/yun}" type="hidden"/>   
            <input name="order_state" value="{yun:}$smarty.get.order_state{/yun}" type="hidden"/>
            <input name="fb" value="{yun:}$smarty.get.fb{/yun}" type="hidden"/>  
			<input name="comid" value="{yun:}$smarty.get.comid{/yun}" type="hidden"/>

			<div class="admin_new_search_name">搜索类型：</div>

    		<div class="admin_Filter_text formselect"  did='dtypeca'>
				<input type="button" value="{yun:}if $smarty.get.typeca==''{/yun}企业名称{yun:}else{/yun}企业ID{yun:}/if{/yun}" class="admin_Filter_but"  id="btypeca">
				<input type="hidden" id='typeca' value="{yun:}if $smarty.get.typeca==''{/yun}1{yun:}else{/yun}{yun:}$smarty.get.typeca{/yun}{yun:}/if{/yun}" name='typeca'>
				<div class="admin_Filter_text_box" style="display:none" id='dtypeca'>
					<ul>
						<li><a href="javascript:void(0)" onClick="formselect('1','typeca','企业名称')">企业名称</a></li>
						<li><a href="javascript:void(0)" onClick="formselect('2','typeca','企业ID')">企业ID</a></li>                  
				  </ul>  
				</div>
			</div>

            <input class="admin_Filter_search"  placeholder="输入你要搜索的关键字" type="text" name="keyword"  size="25" style="float:left"> 
            
			<div class="admin_new_search_name1">任务时间：</div>
            
			<input id="time" class="comy_time_text" type="text" readonly name="time_start1" style="width:100px;" value="{yun:}$smarty.get.time_start1{/yun}" lay-key="1">
            
			<input type="text" id="time_end" class="comy_time_text" name="time_end1" style="width:100px;"  readonly="" value="{yun:}$smarty.get.time_end1{/yun}" lay-key="2">
            
			<input class="admin_Filter_bth"  type="submit" name="news_search" value="检索"/>
			
			<a href="javascript:void(0)" onclick="$('.admin_screenlist_box').toggle();"   class="admin_new_search_gj" style="float:left">高级搜索</a> 
			
		</form>
		{yun:}include file="admin/admin_search.htm"{/yun}
	</div>

	<div class="clear"></div>
	<div class="admin_statistics">
		{yun:}if $smarty.get.comid==""{/yun}
			数据统计：
			<em class="admin_statistics_s">任务总数：<span class="ajaxhelpall">0</span></em>
			<em class="admin_statistics_s">助力人数：<span class="ajaxlogall">0</span></em>
			<em class="admin_statistics_s">已发放权益：<span class="ajaxreceiveall"></span></em>
			<!-- 支付失败金额：<span class="ajaxorderpricefail">0</span>； -->
			搜索结果：<span>{yun:}$total{/yun}</span> 条数据；
		{yun:}else{/yun}
			数据统计：{yun:}$total{/yun}
		{yun:}/if{/yun}
 	</div>    
 
<div class="clear"></div>
<div class="table-list">
<div class="admin_table_border">
<iframe id="supportiframe"  name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe> 
<form action="index.php" name="myform" id='myform' method="get" target="supportiframe">
<input type="hidden" name="pytoken" id='pytoken'  value="{yun:}$pytoken{/yun}">
<input name="m" value="friendhelp" type="hidden"/>
<input name="c" value="del" type="hidden"/>
<table width="100%">
	<thead>
		<tr class="admin_table_top">
		   <th style="width:20px;"><label for="chkall"><input type="checkbox" id='chkAll'  onclick='CheckAll(this.form)'/></label></th>
            
            <th>
			{yun:}if $smarty.get.t=="id" && $smarty.get.order=="asc"{/yun}
			<a href="{yun:}searchurl order=desc t=id m=company_order untype='order,t'{/yun}">编号<img src="images/sanj.jpg"/></a>
            {yun:}else{/yun}
            <a href="{yun:}searchurl order=asc t=id m=company_order untype='order,t'{/yun}">编号<img src="images/sanj2.jpg"/></a>
            {yun:}/if{/yun}
			</th>
			<th align="left">企业名称</th>
			<th align="left">任务时间</th>
			<th align="left">助力人数</th>
            <th align="left" width='560'>任务权益</th>
			<th align="left">任务状态</th>
			<th class="admin_table_th_bg">操作</th>
		</tr>
	</thead>
	<tbody>
   {yun:}foreach item=help key=key from=$rows{/yun}
    <tr align="center"{yun:}if ($key+1)%2=='0'{/yun}class="admin_com_td_bg"{yun:}/if{/yun} id="list{yun:}$help.id{/yun}">
	    <td><input type="checkbox" value="{yun:}$help.id{/yun}" class="check_all" name='del[]' onclick='unselectall()' rel="del_chk" /></td>
    	<td align="left" class="td1"><span>{yun:}$help.id{/yun}</span></td> 
		<td align="left">{yun:}$help.comname{/yun}</td>
        <td align="left">{yun:}$help.stime|date_format:"%Y-%m-%d %H:%M:%S"{/yun} </br>{yun:}$help.etime|date_format:"%Y-%m-%d %H:%M:%S"{/yun}</td>
   	 	
		<td align="left">{yun:}$help.zlnum{/yun}人
        <br/>
        <a href="javascript:void(0)" onClick="logList('{yun:}$help.id{/yun}','{yun:}$help.comname{/yun}');" class="admin_cz_yl">查看记录</a>
        </td>
		<td align="left">
		任务权益：{yun:}foreach from=$help.package item=packlist name=foo{/yun}
		{yun:}$packlist.name{/yun}：{yun:}$packlist.num{/yun}
		
		{yun:}/foreach{/yun}
		</br>
		达标权益：{yun:}foreach from=$help.getpackage item=getpacklist name=foo1{/yun}
		{yun:}$getpacklist.name{/yun}：{yun:}$getpacklist.num{/yun}
		
		{yun:}/foreach{/yun}

		</td>
		
		<td align="left">{yun:}if $help.etime<time(){/yun}<font color='red'>已结束</font>{yun:}else{/yun}<font color='green'>助力中</font>{yun:}/if{/yun}</td>
    	<td align="left" style="text-align:center;">
        	<a href="javascript:void(0)" onClick="layer_del('确定要删除？', 'index.php?m=friendhelp&c=del&id={yun:}$help.id{/yun}');"class="admin_new_c_bth admin_new_c_bth_sc ">删除</a>
        	
        </td>
  </tr>
  {yun:}/foreach{/yun}
  <tr>
  <td align="center"><input type="checkbox" id='chkAll2' onclick='CheckAll2(this.form)' /></td>
  <td colspan="10" >
  <label for="chkAll2">全选</label>&nbsp;
    <input class="admin_button" type="button" name="delsub" value="删除所选" onClick="return really('del[]')" />
    </td>
   </tr>
		{yun:}if $total > $config.sy_listnum {/yun}
			<tr>
				{yun:}if $pagenum==1{/yun}
					<td colspan="3"> 从 1 到 {yun:}$config.sy_listnum {/yun} ，总共 {yun:}$total{/yun} 条</td>
				{yun:}else if $pagenum > 1 && $pagenum < $pages{/yun}
					<td colspan="3"> 从 {yun:}($pagenum-1) * $config.sy_listnum + 1{/yun} 到 {yun:}$pagenum * $config.sy_listnum{/yun} ，总共 {yun:}$total{/yun} 条</td>
				{yun:}else if $pagenum == $pages{/yun}
					<td colspan="3"> 从 {yun:}($pagenum-1) * $config.sy_listnum + 1{/yun} 到 {yun:}$total{/yun} ，总共 {yun:}$total{/yun} 条</td>
				{yun:}/if{/yun}
				<td colspan="8" class="digg">{yun:}$pagenav{/yun}</td>
			</tr>
		{yun:}/if{/yun}
  </tbody>
  </table>
</form>
</div></div>
</div>

<div id="loglist" class="help_userbox none">
<div class="help_usercont">


</div>
</div>
<style>
.admin_resume_dc_sub1{width:350px; text-align:center;}
.admin_new_search_name1{width:60px; line-height:28px; float:left;}
</style>
<script>

layui.use(['laydate'], function(){
	var laydate = layui.laydate
	,$ = layui.$;

	laydate.render({
		elem: '#time'
	});

	laydate.render({
		elem: '#time_end'
	});
});
function check_form(){
	$("input[name=time_start]").val('');
	$("input[name=time_end]").val('');
	var time = $("#time").val();
	var time_end = $("#time_end").val();
	if(time_end != '' && time != ''){
		var date1 = new Date(time+" 00:00:00");
		var time1 = date1.getTime();
		var date2 = new Date(time_end+" 23:59:59");
		var time2 = date2.getTime();
		$("input[name=time_start]").val(time1);
		$("input[name=time_end]").val(time2);
		if(time2<=time1){
			parent.layer.msg('结束时间不能小于开始时间！', 2,8);
			return false
		}
	}else{
		if(time != ''){
			var date1 = new Date(time+" 00:00:00");
			var time1 = date1.getTime();
			$("input[name=time_start]").val(time1);
		}
		if(time_end != ''){
			var date2 = new Date(time_end+" 23:59:59");
			var time2 = date2.getTime();
			$("input[name=time_end]").val(time2);		
		}
	}
}

$(document).ready(function(){
	$.get("index.php?m=friendhelp&c=helpSum", function(data) {
		var datas = eval('(' + data + ')');
		
		$('.ajaxhelpall').html(datas.helpall);
		
		
		$('.ajaxlogall').html(datas.logall);
		
		$('.ajaxreceiveall').html(datas.receiveall);
	
	});


});
function logList(id,name){
	var pytoken=$("#pytoken").val();
	$.post('index.php?m=friendhelp&c=loglist',{id:id,pytoken:pytoken},function(data){
		if(data){
		
			data = eval('('+data+')');
			var html = '<div class="help_userlist help_userlist_top"><span class="help_userlist_xh">序号</span><span class="help_userlist_tx">头像</span><span class="help_userlist_wx">微信名称</span><span class="help_userlist_time">助力时间</span></div>';
			for(var k in data){
				
				html = html + '<div class="help_userlist"><span class="help_userlist_xh">'+(parseInt(k)+1)+'</span><span class="help_userlist_tx"><img src="'+data[k].wxpic+'" width="40" height="40"></span><span class="help_userlist_wx">'+data[k].wxname+'</span><span class="help_userlist_time">'+data[k].time+'</span></div>';
			}
			$('.help_usercont').html(html);
			$.layer({
					type : 1,
					title : name,
					offset : [ '40px', '' ],
					closeBtn : [ 0, true ],
					border : [ 10, 0.3, '#000', true ],
					area : [ '500px', '440px' ],
					page : {
						dom : "#loglist"
					}
				});
	

		}else{
			parent.layer.msg('暂无助力记录！', 2,8);
		}
		
	});

}
</script>
</body>
</html>